package com.stark.friendrequest;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

public class RequestUnavailable extends Activity {

	private ImageButton requestButton;
	private TextView text;
	private String prefName;
	private SharedPreferences prefs;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.request_unavailable);
		
		text=(TextView)findViewById(R.id.notavail);
		
		prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
		
		prefName = prefs.getString("time_remaining",null);
		
		text.setText(prefName);
		
		requestButton=(ImageButton)findViewById(R.id.request_available_button);
		requestButton.setOnClickListener(new Button.OnClickListener(){
		public void onClick(View arg0) {
			//Provide feedback when the button is pressed.
			requestButton.setBackgroundResource(R.drawable.buttonpressed);
		     
		    //Show a toast notification to inform the user a test has been sent
		    Context context = getApplicationContext();
		    CharSequence text = "Tier One Friend Request is Unavailable";
		    int duration = Toast.LENGTH_LONG;
		    Toast toast = Toast.makeText(context, text, duration);
		    toast.show();
		    
		    Intent i = new Intent(RequestUnavailable.this, MainActivity.class);
			startActivity(i);
	    }}); 
	}
	
/*	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}*/

}